import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) //vue全局使用router
// 路由表
const routes=[ //配置路由
  {
  path:'/login', //链接路径
  name:'login', //路由名称
  component:()=>import('@/views/login')//对应的组件模板

},
{
  path:'/',       //底部导航栏
  name:'layout',
  component:()=> import('@/views/layout/'),
  children:[
    {
      path:'/home',//默认子路由 首页
      name:'home',
      component:()=> import('@/views/home/')
    },
    {
      path:'/fenlei',//默认子路由 分类
      name:'fenlei',
      component:()=> import('@/views/fenlei/')
    },
    {
      path:'/gouwuche',//默认子路由 购物车
      name:'gouwuche',
      component:()=> import('@/views/gouwuche/')
    },
    {
      path:'/my',//默认子路由 我的
      name:'my',
      component:()=> import('@/views/my/')
    },
   
  ]
}
]
const router=new VueRouter({
  routes
})
export default router
